import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:xiongan_app_yy/common/user_singleton.dart';
import 'package:xiongan_app_yy/pages/common/car_number_page.dart';
import 'package:xiongan_app_yy/utils/ImageDetailsUtils.dart';
import 'package:xiongan_app_yy/widgets/comm/left_icon_widget.dart';

//二维码名片
class CardQrCodePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return CardQrCodePagePageState();
  }
}

class CardQrCodePagePageState extends State<CardQrCodePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        backgroundColor: Color(0XFF00A5F1),
        automaticallyImplyLeading: false,
        //设置没有返回按钮
        title: Text(
          "二维码名片",
          style: TextStyle(fontSize: 18),
        ),
        elevation: 0,
        centerTitle: true,
        leading: LeftIconWidget(icon: Icons.chevron_left, isize: 36),
      ),
      body: Column(
        children: <Widget>[
          Container(
            width: double.infinity,
            height: 339,
            margin: EdgeInsets.only(left: 20, right: 20, top: 50),
            child: new ClipRRect(
              borderRadius: BorderRadius.circular(10),
              child: Container(
                color: Colors.white,
                alignment: Alignment.center,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    GestureDetector(
                        child: Container(
                          height: 250,
                          child: Center(
                            child: QrImage(
                              data: DataSingleton().Data.id,
                              version: QrVersions.auto,
                            ),
                          ),
                        ),
                        onTap: () {
                          ImageDetailsUtils.jumpImageDetails(
                              context, DataSingleton().Data.id, true);
                        }),
                    Text(
                      "扫一扫二维码图案，了解详情",
                      style: TextStyle(fontSize: 11),
                    )
                  ],
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
